perm filename MATCH[1,PMP] blob
sn#008020 filedate 1971-03-19 generic text, type T, neo UTF8
00100 BEGIN "MATCH"
00200 INTEGER I,J,K,L1,L2,IQ,IZ,II,NUM,I1,I2;
00300 INTEGER ARRAY M1,M2[0:80];
00400 STRING S1,S2;
00450 STRING ARRAY SS[1:100];
00500 OPEN(1,"DSK",1,1,0,200,II,II);
00600 OPEN(2,"LPT",1,0,1,1,1,II);
00650 LOOKUP(1,"STRING",II);
00700 SETBREAK(1,10,13,"ISN");
00800 S1←INPUT(1,1);
00850 NUM←CVD(S1);
00900 FOR I←1 STEP 1 UNTIL NUM DO
00950 BEGIN
00975 SS[I]←INPUT(1,1);
00987 OUT (2,CVS(I)&9&SS[I]&13&10);
00993 END;
00995 OUT(2,13&10);
00997 FOR I1←1 STEP 1 UNTIL NUM DO
00999 BEGIN
01000 FOR I2←1 STEP 1 UNTIL NUM DO
01002 BEGIN
01004 S1←SS[I1];S2←SS[I2];
01006 L1←LENGTH(S1);L2←LENGTH(S2);
01400
01500 FOR I←0 STEP 1 UNTIL 80 DO M1[I]←I;
01600 FOR I←1 STEP 1 UNTIL L2 DO
01700 BEGIN
01800 M2[0]←I;
01900 FOR J←1 STEP 1 UNTIL L1 DO
02000 BEGIN
02100 IQ←1000;
02200 FOR K←0 STEP 1 UNTIL J-1 DO
02300 BEGIN
02400 IZ←M1[K]+J-K-1;
02500 IF IZ<IQ THEN IQ←IZ;
02600 END;
02700 IF S1[J FOR 1]≠S2[I FOR 1] THEN IQ←IQ+1;
02800 IZ←M1[J]+1;
02900 IF IZ<IQ THEN IQ←IZ;
03000 M2[J]←IQ;
03100 END;
03200 FOR J←0 STEP 1 UNTIL L1 DO
03300 M1[J]←M2[J];
03700 END;
03800 IQ←M1[0]+L1;
03850 M1[0]←IQ;
03900 FOR I←1 STEP 1 UNTIL L1 DO
03950 BEGIN
03975 M1[I]←M1[I]+L1-I;
04000 IF M1[I]<IQ THEN IQ←M1[I];
04050 END;
04300 OUT(2,CVS(IQ)&" ");
04310 END;
04320 OUT(2,13&10);END;;
04400 CLOSE(2);CLOSE(1);
04500 END;END;END;END;END;
04600 END;